<template>
<a-config-provider :locale="locale === 'en' ? enUS : zhCN">
<div class="main">
 {{ str }}1111111111111111111111111
</div>

</a-config-provider> 

</template>

<script lang="ts">
const { ipcRenderer } = require("electron");
// import { ipcRenderer } from 'electron'
import { defineComponent, Ref, ref,reactive} from 'vue'
import enUS from 'ant-design-vue/es/locale/en_US'
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import 'moment/dist/locale/zh-cn'

export default defineComponent({
  name: 'App',
  components: {
  },
  setup () {
    let pageData = reactive({
      str:"init",
    })
     ipcRenderer.send("sendMessage",1);
    const locale: Ref<string> = ref('zh') 
    setInterval(()=>{
     ipcRenderer.send("sendMessage",1);
    },10000)
    ipcRenderer.on('asynchronous-reply', function(event, data) {
       pageData.str = data 
       var arr = data.split("\n")
       console.log(arr); 
       arr.map((e:any)=>e.split(','))
       console.log(arr); 
       
    })
    return { locale, enUS, zhCN }
  }
})
</script>

<style>
html,body,#app{
  /* background-color:rgba(0,0,0,1); */
}
.main{
  height: 500px;
}
</style>
